import type {MenuOption} from "naive-ui"
import {h} from "vue"
import {RouterLink} from "vue-router"
import serverRoute from "../../../../../router/routes/server-route"

const menuOptions: MenuOption[] = [
  // 根据和服务器相关的页面路由映射生成相应的菜单选项
  ...serverRoute.map((route) => {
    return {
      label: () => {
        return h(
          RouterLink,
          {
            to: {name: route.name}
          },
          {default: () => route.meta?.title}
        )
      },
      key: route.name as string,
    }
  }),
  {
    label: '舞，舞，舞',
    key: 'dance-dance-dance',
    children: [
      {
        type: 'group',
        label: '人物',
        key: 'people',
        children: [
          {
            label: '叙事者',
            key: 'narrator',
          },
          {
            label: '羊男',
            key: 'sheep-man',
          }
        ]
      },
      {
        label: '饮品',
        key: 'beverage',
        children: [
          {
            label: '威士忌',
            key: 'whisky'
          }
        ]
      },
      {
        label: '食物',
        key: 'food',
        children: [
          {
            label: '三明治',
            key: 'sandwich'
          }
        ]
      },
      {
        label: '过去增多，未来减少',
        key: 'the-past-increases-the-future-recedes'
      }
    ]
  }
]

export default menuOptions
